package com.usian.admin.controller;

import com.usian.admin.feign.MediaFeign;
import com.usian.admin.service.NewsAutoScanService;
import com.usian.model.admin.dtos.NewsAuthDto;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.vos.WmNewsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1/admin")
public class AdminScanController {
    @Autowired
    private MediaFeign mediaFeign;
    @Autowired
    private NewsAutoScanService scanService;

    @PostMapping("get/scan/list")
    public ResponseResult findList(@RequestBody NewsAuthDto dto) {
        return mediaFeign.findList(dto);
    }

    @GetMapping("/find_news_vo/{id}")//1542399650272436336
    public WmNewsVo findWmNewsVo(@PathVariable("id") Long id) {
        return mediaFeign.findWmNewsVo(id);
    }

    @PostMapping("admin/scan")
    public ResponseResult adminScan(Long newsId, Short operation) {
        return scanService.adminScan(newsId,operation);
    }
}
